import { Component, OnInit, Input } from "@angular/core";
import { HttpService } from "src/app/shared/service/http.service";
import { AppGlobalService } from "src/app/shared/service/app-global.service";

@Component({
  selector: "app-recommand-info",
  templateUrl: "./recommand-info.component.html",
  styleUrls: ["./recommand-info.component.scss"],
})
export class RecommandInfoComponent implements OnInit {
  @Input() tagData: any = {};
  constructor(
    private httpService: HttpService,
    private appGlobalService: AppGlobalService
  ) {}

  ngOnInit() {}

  call(phone) {
    if (phone) {
      this.httpService.changeCallNumber(phone);
    }
  }

  handleClick(item) {
    const sessionId = localStorage.getItem("sessionId");
    const pageParams = {
      pageId: item.target,
      params: item.params,
      sessionId,
    };
    this.appGlobalService.goToForward(pageParams);
  }
}
